<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="org.springside.core.Constants"%>
<%@ include file="/common/taglibs.jsp" %>
<fmt:message key="docexFile_edit_label52" var="docexFile_edit_label52"/>
<c:set var="web_office_ocx"><%=Constants.WEB_OFFICE_OCX %></c:set>
<c:set var="currenturl"><%=request.getRequestURI()%></c:set>
<!-- 如果是协同工作模块调用office控件,直接使用weboffice -->
<c:if test="${fn:contains(currenturl,'modules/docex') && param.method=='create'}">
<c:set var="web_office_ocx">WebOffice</c:set>
</c:if>

<c:choose>
	<c:when test="${web_office_ocx == 'WebOffice'}">
		<SCRIPT src="../../scripts/weboffice/dianju_weboffice.js" type="text/javascript" language="JavaScript"></SCRIPT>
    	<ff:box>
    	<SCRIPT type="text/javascript" language="javascript">
    	writeDianjuWebOffice("FramerControl1", "<%=Constants.DIANJU_WEBOFFICE_VERSION%>", "100%", "720px");
		
		// 初始化控件，加载文档
		function initWebofficeOcx(fileUrl, documentType){ // 控件默认初始化方法，各页面有个性初始化的在各页面单独初始化
			if(!checkWebofficeOBjExists()){
				return;
			}
			openDocumentFromUrl(fileUrl, documentType);
		}
		</SCRIPT>
		</ff:box>
	</c:when>
	<c:when test="${web_office_ocx == 'iWebOffice' && false}"><!-- 暂不处理金格控件 -->
		<SCRIPT src="../../scripts/weboffice/goldgrid_weboffice.js" type="text/javascript" language="JavaScript"></SCRIPT>
		<OBJECT classid="clsid:8B23EA28-723C-402F-92C4-59BE0E063499"
			codebase="<c:url value="/components/dsoframer/iWebOffice2006.cab#version="/><%=Constants.GOLDGRID_IWEBOFFICE_VERSION%>"
			id=FramerControl1 name=FramerControl1
			style="LEFT: 0px; TOP: 0px; WIDTH: 100%; HEIGHT: 878px">
		</OBJECT>
		<SCRIPT type="text/javascript" language="javascript">
		
		
		</SCRIPT>
	</c:when>
	<c:otherwise>
		<SCRIPT src="../../scripts/weboffice/ntko_weboffice.js" type="text/javascript" language="JavaScript"></SCRIPT>
		<SCRIPT src="../../scripts/weboffice/NtkoAddSecSign.js" type="text/javascript" language="JavaScript"></SCRIPT>
    	<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
    	writeNtkoOffice('FramerControl1', '<%=Constants.NTKO_WEBOFFICE_VERSION%>', '100%', '720px');
		// 初始化控件，异步加载文档
		function initWebofficeOcx(fileUrl, documentType){
			if(!isOCXLoaded()){
				return;
			}
			if(fileUrl != '' && fileUrl != null){
				//loadDocumentFromURL(fileUrl,documentType,false);
				syncLoadDocumentFromURL(fileUrl,documentType,true,false);
			}else{
				createNew("Word.Document");
			}
		}
		</SCRIPT>
		
 	</c:otherwise>
</c:choose>
<script type="text/vbscript" src="<c:url value='/scripts/weboffice/weboffice.vbs.jsp'/>"></script>